package com.sunwayworld.basemodule.basedata.specjudgetype.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.sunwayworld.framework.spring.annotation.GikamBean;

import com.sunwayworld.basemodule.basedata.specjudgetype.dao.LimsSpecJudgeTypeDao;
import com.sunwayworld.basemodule.basedata.specjudgetype.bean.LimsSpecJudgeTypeBean;
import com.sunwayworld.basemodule.basedata.specjudgetype.service.LimsSpecJudgeTypeService;
import com.sunwayworld.framework.context.ApplicationContextHelper;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@Repository
@GikamBean
public class LimsSpecJudgeTypeServiceImpl implements LimsSpecJudgeTypeService {

    @Autowired
    private LimsSpecJudgeTypeDao limsSpecJudgeTypeDao;

    @Override
    public LimsSpecJudgeTypeDao getDao() {
        return limsSpecJudgeTypeDao;
    }

    @Override
    @Transactional
    public String insert(RestJsonWrapperBean jsonWrapper) {
        LimsSpecJudgeTypeBean specJudgeType = jsonWrapper.parseUnique(LimsSpecJudgeTypeBean.class);
        specJudgeType.setId(ApplicationContextHelper.getNextSequence(getDao().getTable(),"J"));
        getDao().insert(specJudgeType);
        return specJudgeType.getId();
    }

}
